// 分页组件

import React, {Component,Fragment} from 'react';


class Pagination extends Component{
	constructor(props) {
		super(props);
		this.state = {
			current:props.current || 0,
			defaultCurrent:props.defaultCurrent || 1,
			defaultPageSize:props.defaultPageSize || 20,
			hideOnSinglePage:props.hideOnSinglePage||false,     //当只有一页 隐藏分页器
			total:props.total || 0,
		}
	}
	
	componentDidMount() {
	
	}
	
	componentWillMount() {
	
	}
	
	renderList(){
		const {total, defaultPageSize} = this.state;
		if(total === 0){
			this.setState({
				hideOnSinglePage:true
			})
		}
		if(Math.ceil(total/defaultPageSize ) === 1){
			//只有一页
			
		} else {
			const num = Math.ceil(total/defaultPageSize );
			
		}
	}
	
	render() {
		return (
			<Fragment>
				{
					this.renderList()
				}
			</Fragment>
		)
	}
	
}

export default Pagination